package com.w.tank;

public class TankTankColl implements Collider{


    @Override
    public boolean collide(GameObject g1, GameObject g2) {
        if(g1 instanceof Tank && g2 instanceof Tank){
            Tank tk1 = (Tank)g1;
            Tank tk2 = (Tank)g2;
            if(tk1.rect.intersects(tk2.rect)){
                tk1.setX(tk1.old_x);
                tk1.setY(tk1.old_y);
                tk2.setX(tk2.old_x);
                tk2.setY(tk2.old_y);

            }
        }
        return false;
    }
}
